package org.yaac.client.ui;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;

public class EditorEntityNotFoundPanel extends Composite {

	private static EditorEntityNotFoundPanelUiBinder uiBinder = GWT.create(EditorEntityNotFoundPanelUiBinder.class);

	interface EditorEntityNotFoundPanelUiBinder extends UiBinder<Widget, EditorEntityNotFoundPanel> {
	}

	static interface CreateButtonHandler {
		void onButtonClick();
	}
	
	@UiField
	Button createBtn;
	
	private final CreateButtonHandler handler;
	
	EditorEntityNotFoundPanel(CreateButtonHandler handler) {
		this.handler = handler;
		
		initWidget(uiBinder.createAndBindUi(this));
	}

	@UiHandler("createBtn") 
	void onCreateBtnClick(ClickEvent event) {
		this.handler.onButtonClick();
	}
}
